<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
        <meta name="format-detection" content="telephone=no">
        <title>个人介绍</title>
        
        <script src="./Public/frozenui/js/lib/zeptojs/zepto.min.js"></script>
        <script src="./Public/frozenui/js/frozen.js"></script>
        <link rel="stylesheet" href="./Public/Kmic/css/index.css">
        <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">   
        <script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>       
    </head>
    <body>
        <div class="col-xs-12 ptm20">
            <form id="dosubmit" action="">
                <textarea name="info" class="user_content mb10"></textarea>
                <input type="hidden" name="openid" value="{$Think.get.openid}" />
            </form>
            <div  class="col999 mb10"><div class="zhuyi">!</div>一份好的个人介绍能帮你更好地接近客户。</div>
        </div>
        
        <div class="clearfix"></div>
        <div class="col-xs-12">
           <div class="button_wbut text-center msg_subtim">提交</div>
        </div>
   
        <script>
            $.ajax({
                cache: true,
                type: "POST",
                url:"?m=Center&c=Profile&a=setMessage&action=msg&openid={$Think.get.openid}",
                data:$('#dosubmit').serialize(),// 序列号formid
                async: false,
                dataType: 'json',
                error: function(request) {
                    alert('提交超时，请稍候再试！');
                },
                success: function(data) {
                    console.log(data);
                    if (data.error == 0) {
                        $(".user_content").val(data.info);
                    }
                }
            });  
            
            $(".msg_subtim").click(function(){            
                $.ajax({
                    cache: true,
                    type: "POST",
                    url:"?m=Center&c=Profile&a=addMessage&action=msg",
                    data:$('#dosubmit').serialize(),// 序列号formid
                    async: false,
                    dataType: 'json',
                    error: function(request) {
                        alert('提交超时，请稍候再试！');
                    },
                    success: function(data) {
                        console.log(data);
                        if (data.error == 0) {
                            alert('发布成功！');
                          //  window.location.href="?m=web&a=profiles&openid={$Think.get.openid}";
                        }else if (data.error == 1) {
                            alert(data.msg);
                        }
                    }
                });
                
            });            
        </script>
    </body>
</html>

